<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>店面发送信息统计</title>
	<meta name="decorator" content="default"/>
	<style type="text/css">
		th {text-align: center !important;}
		td {text-align: center !important;}
		#searchForm div.ui-input-text {
			padding: 0.4em;
			display:inline-block;
		}
		#searchForm div.ui-input-button {
			padding: 0.4em;
			display:inline-block;
		}
	</style>
	<script type="text/javascript">
		$(document).ready(function() {
		 	jQuery("#searchForm").validate({
		 		submitHandler: function(form){
					var startValue = $("#startDate").val();
					if (!startValue){
						showTip("开始日期必须填写!");
						return;
					}
					var endValue = $("#endDate").val();
					if (!endValue){
						showTip("结束日期必须填写!");
						return;
					}
					if(startValue && endValue){
						 var start = new Date(startValue.replace(/-/g, "/"));
						 var end = new Date(endValue.replace(/-/g, "/"));
						 if (end < start) {
							showTip("结束日期不能大于开始日期!");
							return;
						}
					 }
	    			 bossLoginSubmit('${fns:getStore().bossPassword}', form, 'search');
				}
	        });
	        $("#clearBtn").click(function(){
				$("#startDate").val("");
				$("#endDate").val("");
			});
		});
	</script>
</head>
<body>
	<div class="icon-buttons">
		<input type="button" class="leave-clean-session" data-inline="true" data-icon="back" data-iconpos="notext" value="返回"/>
	</div>
	<tags:breadcrumb name="breadcrumb" />
	<form:form id="searchForm" modelAttribute="logStoreMsg" action="${ctx}/sms/logStoreMsg/remain" method="post" class="breadcrumb form-search">
		<label>开始日期：</label>
		<input type="date" id="startDate" data-inline="true" name="startDate" value="${startDate}"/>
		<label>结束日期：</label>
		<input type="date" id="endDate" data-inline="true" name="endDate"value="${endDate}"/>
		<input data-inline="true" type="submit" value="查询"/>
		<input id="clearBtn" data-inline="true" type="button" value="清空"/>
	</form:form>
	<div>
		<c:if test="${not empty allSendSmsSize}">
			您的店面在此期间所发送的短信${allSendSmsSize}条（折算成实际短信数量：${allRealSmsSize}条，每64个字为一条。）<br/><br/>
			您的店面剩余短信${remainSms}条
		</c:if>
	</div>
</body>
</html>
